3.205 \(\int \frac {\tan (x)}{\cot (x)+\csc (x)} \, dx\)

Optimal. Leaf size=7 \[ \tanh ^{-1}(\sin (x))-x \]

[Out]

-x+arctanh(sin(x))

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 7, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {4392, 2839, 3770, 8} \[ \tanh ^{-1}(\sin (x))-x \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]/(Cot[x] + Csc[x]),x]

[Out]

-x + ArcTanh[Sin[x]]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2839

Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.))/((a_) + (b_.)*sin[(e_.) + (f_
.)*(x_)]), x_Symbol] :> Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Dist[g^2/(b*d),
Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2
 - b^2, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4392

Int[(cot[(c_.) + (d_.)*(x_)]^(n_.)*(a_.) + csc[(c_.) + (d_.)*(x_)]^(n_.)*(b_.))^(p_)*(u_.), x_Symbol] :> Int[A
ctivateTrig[u]*Csc[c + d*x]^(n*p)*(b + a*Cos[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rubi steps

\begin {align*} \int \frac {\tan (x)}{\cot (x)+\csc (x)} \, dx &=\int \frac {\sin (x) \tan (x)}{1+\cos (x)} \, dx\\ &=-\int 1 \, dx+\int \sec (x) \, dx\\ &=-x+\tanh ^{-1}(\sin (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.03, size = 36, normalized size = 5.14 \[ -x-\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]/(Cot[x] + Csc[x]),x]

[Out]

-x - Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]]

________________________________________________________________________________________

fricas [B]  time = 0.71, size = 20, normalized size = 2.86 \[ -x + \frac {1}{2} \, \log \left (\sin \relax (x) + 1\right ) - \frac {1}{2} \, \log \left (-\sin \relax (x) + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(cot(x)+csc(x)),x, algorithm="fricas")

[Out]

-x + 1/2*log(sin(x) + 1) - 1/2*log(-sin(x) + 1)

________________________________________________________________________________________

giac [B]  time = 0.22, size = 22, normalized size = 3.14 \[ -x + \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right ) - \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(cot(x)+csc(x)),x, algorithm="giac")

[Out]

-x + log(abs(tan(1/2*x) + 1)) - log(abs(tan(1/2*x) - 1))

________________________________________________________________________________________

maple [B]  time = 0.11, size = 21, normalized size = 3.00 \[ -\ln \left (\tan \left (\frac {x}{2}\right )-1\right )+\ln \left (\tan \left (\frac {x}{2}\right )+1\right )-x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)/(cot(x)+csc(x)),x)

[Out]

-ln(tan(1/2*x)-1)+ln(tan(1/2*x)+1)-x

________________________________________________________________________________________

maxima [B]  time = 0.43, size = 39, normalized size = 5.57 \[ -2 \, \arctan \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1}\right ) + \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right ) - \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(cot(x)+csc(x)),x, algorithm="maxima")

[Out]

-2*arctan(sin(x)/(cos(x) + 1)) + log(sin(x)/(cos(x) + 1) + 1) - log(sin(x)/(cos(x) + 1) - 1)

________________________________________________________________________________________

mupad [B]  time = 0.57, size = 11, normalized size = 1.57 \[ 2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )-x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)/(cot(x) + 1/sin(x)),x)

[Out]

2*atanh(tan(x/2)) - x

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan {\relax (x )}}{\cot {\relax (x )} + \csc {\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(cot(x)+csc(x)),x)

[Out]

Integral(tan(x)/(cot(x) + csc(x)), x)

________________________________________________________________________________________